//
//  BarCodeController.m
//  MyNewWeiBo
//
//  Created by wpapple on 16/6/1.
//  Copyright © 2016年 heron. All rights reserved.
//

#import "BarCodeController.h"

@interface BarCodeController ()
@property (weak, nonatomic) IBOutlet UIImageView *animationsView;

@end

@implementation BarCodeController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.animationsView.transform = CGAffineTransformMakeRotation(-M_PI_2);
    
    CADisplayLink * link = [CADisplayLink displayLinkWithTarget:self selector:@selector(moveAnimations:)];
    [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
    link.frameInterval = 0.1;
}

- (void)moveAnimations:(CADisplayLink *)link{
    self.animationsView.x += 3;
    if (self.animationsView.x >= 250 - 150) {
        self.animationsView.x = -150;
    }
}
- (IBAction)close:(UIBarButtonItem *)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
